package com.woniuxy.controller;

import com.woniuxy.pojo.Car;
import com.woniuxy.pojo.CarAmount;
import com.woniuxy.pojo.CarTotalAmount;
import com.woniuxy.service.CarAmountService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class ChartsController {
    private Logger logger = LoggerFactory.getLogger(this.getClass());
    @Autowired
    private CarAmountService carAmountService;

    @GetMapping(value = "/cars/showInfo.do")
    public List<CarAmount> selectById(Integer id) {
        return carAmountService.selectById(id);
    }

    @GetMapping(value = "/cars/selectAllCars.do")
    public List<Car> selectAllCars(){
        return carAmountService.selectAllCars();
    }

    @GetMapping(value = "/cars/showAll.do")
    public List<CarTotalAmount> selectAll() {
        return carAmountService.selectAll();
    }
}
